package com.example.aop;

import com.example.aop.controller.Iface;
import com.example.aop.controller.TestController;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class SpringAopApplication {

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(SpringAopApplication.class, args);

        //代理类
        TestController bean = context.getBean(TestController.class);
        System.out.println(bean);

        //代理接口
        Iface iface = (Iface) context.getBean("testController2");
        System.out.println(iface);

    }

}
